//package com.office.utils;
//
//import com.office.dataobject.*;
//import com.office.mapper.*;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//
//import java.util.List;
//
///**
// * ��Mybatis Generator��ǿ�����ɣ���Ҫ�ֶ��޸�
// *
// * @author Exception
// * @see <a href="https://github.com/pocketdigi/mybatis-generator">https://github.com/pocketdigi/mybatis-generator</a>
// */
//public final class PageHelper {
//    private SqlSessionFactory sessionFactory;
//
//    public PageHelper(SqlSessionFactory sessionFactory) {
//        this.sessionFactory = sessionFactory;
//    }
//
//    public Page<BusinessCircles> selectByExamplePaging(BusinessCirclesExample example, int currentPage, int pageSize) {
//        try (SqlSession sqlSession = sessionFactory.openSession()) {
//            BusinessCirclesMapper mapper = sqlSession.getMapper(BusinessCirclesMapper.class);
//            if (currentPage <= 0) {
//                currentPage = 1;
//            }
//            if (pageSize <= 0) {
//                pageSize = 10;
//            }
//            long totalCount = mapper.countByExample(example);
//            List<BusinessCircles> dataList = mapper.selectByExamplePaging(example, (currentPage - 1) * pageSize, pageSize);
//            Page<BusinessCircles> pageObj = new Page<>();
//            pageObj.setCurrentPage(currentPage);
//            pageObj.setPageSize(pageSize);
//            pageObj.setDataList(dataList);
//            pageObj.setTotalCount(totalCount);
//            pageObj.setTotalPage((int) Math.ceil(totalCount / (float) pageSize));
//            return pageObj;
//        }
//    }
//
//    public Page<BusinessExcelCompany> selectByExamplePaging(BusinessExcelCompanyExample example, int currentPage, int pageSize) {
//        try (SqlSession sqlSession = sessionFactory.openSession()) {
//            BusinessExcelCompanyMapper mapper = sqlSession.getMapper(BusinessExcelCompanyMapper.class);
//            if (currentPage <= 0) {
//                currentPage = 1;
//            }
//            if (pageSize <= 0) {
//                pageSize = 10;
//            }
//            long totalCount = mapper.countByExample(example);
//            List<BusinessExcelCompany> dataList = mapper.selectByExamplePaging(example, (currentPage - 1) * pageSize, pageSize);
//            Page<BusinessExcelCompany> pageObj = new Page<>();
//            pageObj.setCurrentPage(currentPage);
//            pageObj.setPageSize(pageSize);
//            pageObj.setDataList(dataList);
//            pageObj.setTotalCount(totalCount);
//            pageObj.setTotalPage((int) Math.ceil(totalCount / (float) pageSize));
//            return pageObj;
//        }
//    }
//
//    public Page<BusinessOrange> selectByExamplePaging(BusinessOrangeExample example, int currentPage, int pageSize) {
//        try (SqlSession sqlSession = sessionFactory.openSession()) {
//            BusinessOrangeMapper mapper = sqlSession.getMapper(BusinessOrangeMapper.class);
//            if (currentPage <= 0) {
//                currentPage = 1;
//            }
//            if (pageSize <= 0) {
//                pageSize = 10;
//            }
//            long totalCount = mapper.countByExample(example);
//            List<BusinessOrange> dataList = mapper.selectByExamplePaging(example, (currentPage - 1) * pageSize, pageSize);
//            Page<BusinessOrange> pageObj = new Page<>();
//            pageObj.setCurrentPage(currentPage);
//            pageObj.setPageSize(pageSize);
//            pageObj.setDataList(dataList);
//            pageObj.setTotalCount(totalCount);
//            pageObj.setTotalPage((int) Math.ceil(totalCount / (float) pageSize));
//            return pageObj;
//        }
//    }
//
//    public Page<BusinessCompany> selectByExamplePaging(BusinessCompanyExample example, int currentPage, int pageSize) {
//        try (SqlSession sqlSession = sessionFactory.openSession()) {
//            BusinessCompanyMapper mapper = sqlSession.getMapper(BusinessCompanyMapper.class);
//            if (currentPage <= 0) {
//                currentPage = 1;
//            }
//            if (pageSize <= 0) {
//                pageSize = 10;
//            }
//            long totalCount = mapper.countByExample(example);
//            List<BusinessCompany> dataList = mapper.selectByExamplePaging(example, (currentPage - 1) * pageSize, pageSize);
//            Page<BusinessCompany> pageObj = new Page<>();
//            pageObj.setCurrentPage(currentPage);
//            pageObj.setPageSize(pageSize);
//            pageObj.setDataList(dataList);
//            pageObj.setTotalCount(totalCount);
//            pageObj.setTotalPage((int) Math.ceil(totalCount / (float) pageSize));
//            return pageObj;
//        }
//    }
//
//    public Page<WebmagicCircles> selectByExamplePaging(WebmagicCirclesExample example, int currentPage, int pageSize) {
//        try (SqlSession sqlSession = sessionFactory.openSession()) {
//            WebmagicCirclesMapper mapper = sqlSession.getMapper(WebmagicCirclesMapper.class);
//            if (currentPage <= 0) {
//                currentPage = 1;
//            }
//            if (pageSize <= 0) {
//                pageSize = 10;
//            }
//            long totalCount = mapper.countByExample(example);
//            List<WebmagicCircles> dataList = mapper.selectByExamplePaging(example, (currentPage - 1) * pageSize, pageSize);
//            Page<WebmagicCircles> pageObj = new Page<>();
//            pageObj.setCurrentPage(currentPage);
//            pageObj.setPageSize(pageSize);
//            pageObj.setDataList(dataList);
//            pageObj.setTotalCount(totalCount);
//            pageObj.setTotalPage((int) Math.ceil(totalCount / (float) pageSize));
//            return pageObj;
//        }
//    }
//}